<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function make</title>
<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Boost.Test">
<link rel="up" href="../../../header/boost/test/data/monomorphic/fwd_hpp.html" title="Header &lt;boost/test/data/monomorphic/fwd.hpp&gt;">
<link rel="prev" href="result_of/make.html" title="Struct template make">
<link rel="next" href="../../../header/boost/test/data/monomorphic/generate_hpp.html" title="Header &lt;boost/test/data/monomorphic/generate.hpp&gt;">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="result_of/make.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../header/boost/test/data/monomorphic/fwd_hpp.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../../header/boost/test/data/monomorphic/generate_hpp.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.unit_test.data.make"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function make</span></h2>
<p>boost::unit_test::data::make — Creates a dataset from a value, a collection or an array. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../header/boost/test/data/monomorphic/fwd_hpp.html" title="Header &lt;boost/test/data/monomorphic/fwd.hpp&gt;">boost/test/data/monomorphic/fwd.hpp</a>&gt;

</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> DataSet<span class="special">&gt;</span> 
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">enable_if</span><span class="special">&lt;</span> <a class="link" href="monomorphic/is_dataset.html" title="Struct template is_dataset">monomorphic::is_dataset</a><span class="special">&lt;</span> <span class="identifier">DataSet</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span><span class="special">,</span> <span class="identifier">DataSet</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> 
  <span class="identifier">make</span><span class="special">(</span><span class="identifier">DataSet</span> <span class="special">&amp;&amp;</span> ds<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">enable_if</span><span class="special">&lt;</span><span class="special">!</span><a class="link" href="../is_conta_idm44970733017504.html" title="Struct template is_container_forward_iterable">is_container_forward_iterable</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span> <span class="special">&amp;&amp;</span><span class="special">!</span><a class="link" href="monomorphic/is_dataset.html" title="Struct template is_dataset">monomorphic::is_dataset</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span> <span class="special">&amp;&amp;</span><span class="special">!</span><span class="identifier">is_array</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">remove_reference</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span><span class="special">,</span> <a class="link" href="monomorphic/singleton.html" title="Class template singleton">monomorphic::singleton</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> 
  <span class="identifier">make</span><span class="special">(</span><span class="identifier">T</span> <span class="special">&amp;&amp;</span> v<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> C<span class="special">&gt;</span> 
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">enable_if</span><span class="special">&lt;</span> <a class="link" href="../is_conta_idm44970733017504.html" title="Struct template is_container_forward_iterable">is_container_forward_iterable</a><span class="special">&lt;</span> <span class="identifier">C</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span><span class="special">,</span> <a class="link" href="monomorphic/collection.html" title="Class template collection">monomorphic::collection</a><span class="special">&lt;</span> <span class="identifier">C</span> <span class="special">&gt;</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> 
  <span class="identifier">make</span><span class="special">(</span><span class="identifier">C</span> <span class="special">&amp;&amp;</span> c<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> size<span class="special">&gt;</span> 
  <a class="link" href="monomorphic/array.html" title="Class template array">monomorphic::array</a><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_const</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <span class="special">&gt;</span> <span class="identifier">make</span><span class="special">(</span><span class="identifier">T</span><span class="special">(</span><span class="special">&amp;</span><span class="special">)</span> a<span class="special">)</span><span class="special">;</span>
<a class="link" href="monomorphic/singleton.html" title="Class template singleton">monomorphic::singleton</a><span class="special">&lt;</span> <span class="keyword">char</span> <span class="special">*</span> <span class="special">&gt;</span> <span class="identifier">make</span><span class="special">(</span><span class="keyword">char</span> <span class="special">*</span> str<span class="special">)</span><span class="special">;</span>
<a class="link" href="monomorphic/singleton.html" title="Class template singleton">monomorphic::singleton</a><span class="special">&lt;</span> <span class="keyword">char</span> <span class="keyword">const</span>  <span class="special">*</span> <span class="special">&gt;</span> <span class="identifier">make</span><span class="special">(</span><span class="keyword">char</span> <span class="keyword">const</span> <span class="special">*</span> str<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
  <a class="link" href="monomorphic/init_list.html" title="Class template init_list">monomorphic::init_list</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="identifier">make</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">initializer_list</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">class</span> <span class="special">...</span> Args<span class="special">&gt;</span> 
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">enable_if</span><span class="special">&lt;</span> <span class="special">!</span><a class="link" href="monomorphic/has_dataset.html" title="Struct template has_dataset">monomorphic::has_dataset</a><span class="special">&lt;</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">Args</span><span class="special">...</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">value</span><span class="special">,</span> <a class="link" href="monomorphic/init_list.html" title="Class template init_list">monomorphic::init_list</a><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;&gt;</span><span class="special">::</span><span class="identifier">type</span> 
  <span class="identifier">make</span><span class="special">(</span><span class="identifier">T</span> <span class="special">&amp;&amp;</span> arg0<span class="special">,</span> <span class="identifier">Args</span> <span class="special">&amp;&amp;</span><span class="special">...</span> args<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45283077588192"></a><h2>Description</h2>
<p>This function has several overloads: </p>
<pre class="programlisting"><span class="comment">// returns ds if ds is already a dataset</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">DataSet</span><span class="special">&gt;</span> <span class="identifier">DataSet</span> <span class="identifier">make</span><span class="special">(</span><span class="identifier">DataSet</span><span class="special">&amp;&amp;</span> <span class="identifier">ds</span><span class="special">)</span><span class="special">;</span> 

<span class="comment">// creates a singleton dataset, for non forward iterable and non dataset type T</span>
<span class="comment">// (a C string is not considered as a sequence).</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">monomorphic</span><span class="special">::</span><span class="identifier">singleton</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">make</span><span class="special">(</span><span class="identifier">T</span><span class="special">&amp;&amp;</span> <span class="identifier">v</span><span class="special">)</span><span class="special">;</span> 
<span class="identifier">monomorphic</span><span class="special">::</span><span class="identifier">singleton</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">*</span><span class="special">&gt;</span> <span class="identifier">make</span><span class="special">(</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">str</span> <span class="special">)</span><span class="special">;</span>
<span class="identifier">monomorphic</span><span class="special">::</span><span class="identifier">singleton</span><span class="special">&lt;</span><span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span><span class="special">&gt;</span> <span class="identifier">make</span><span class="special">(</span> <span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">str</span> <span class="special">)</span><span class="special">;</span>

<span class="comment">// creates a collection dataset, for forward iterable and non dataset type C</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">C</span><span class="special">&gt;</span> <span class="identifier">monomorphic</span><span class="special">::</span><span class="identifier">collection</span><span class="special">&lt;</span><span class="identifier">C</span><span class="special">&gt;</span> <span class="identifier">make</span><span class="special">(</span><span class="identifier">C</span> <span class="special">&amp;&amp;</span> <span class="identifier">c</span><span class="special">)</span><span class="special">;</span>

<span class="comment">// creates an array dataset</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">size</span><span class="special">&gt;</span> <span class="identifier">monomorphic</span><span class="special">::</span><span class="identifier">array</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">make</span><span class="special">(</span> <span class="identifier">T</span> <span class="special">(</span><span class="special">&amp;</span><span class="identifier">a</span><span class="special">)</span><span class="special">[</span><span class="identifier">size</span><span class="special">]</span> <span class="special">)</span><span class="special">;</span>
</pre>
<p> </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2001-2020 Boost.Test contributors<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="result_of/make.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../header/boost/test/data/monomorphic/fwd_hpp.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../../header/boost/test/data/monomorphic/generate_hpp.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
